package edu.zut.software.identity.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;

@RestController
@EnableAutoConfiguration
public class Indexcontroller {
    @Value("${username1}")
    private String username;
    @Value("${password1}")
    private String password;

    @GetMapping("/login/{name}/{password}")
    public String index(@PathVariable String name,@PathVariable String password){
        System.out.println("username:"+username +"password:"+password);
      if (username.equals(name)&&password.equals(password)){
          return "success";
      }
      else {
          return "error";
      }
    }

    public static void main(String[] args) {
        SpringApplication.run(Indexcontroller.class,args);
    }
}
